const path = require('path');

module.exports = {
  webpack: {
    alias: {
      '@components': path.resolve(__dirname, './src/components'),
      '@images': path.resolve(__dirname, './src/images'),
      '@services': path.resolve(__dirname, './src/services'),
      '@utils': path.resolve(__dirname, './src/utils'),
      '@pages': path.resolve(__dirname, './src/pages'),
      '@layout': path.resolve(__dirname, './src/layout'),
      '@routers': path.resolve(__dirname, './src/routers'),
      '@reducers': path.resolve(__dirname, './src/redux/reducers'),
      '@api': path.resolve(__dirname, './src/api'),
      '@schemas': path.resolve(__dirname, './src/schemas')
    },
  },
  babel: {
    plugins: [["@babel/plugin-proposal-decorators", { legacy: true }]]
  },
  // 配置请求代理
  devServer: {
    proxy: {
      '/api': {
        target: 'http://192.168.2.163:8888',
        changeOrigin: true,
        pathRewrite: {
          "^/api": ''
        }
      }
    },
  },
};